/**
 * 添加或者修改页面
 */
var BKeywordAutoBackInfoDlg = {
    data: {
        appId: "",
        keyworld: "",
        matchType: "",
        returnType: "",
        url: "",
        title: "",
        context: "",
        videoUrl: "",
        iamgeUrl: "",
        updateTime: "",
        updateUser: "",
        createTime: "",
        createUser: ""
    }
};

layui.use(['form', 'admin', 'ax'], function () {
    var $ = layui.jquery;
    var $ax = layui.ax;
    var form = layui.form;
    var admin = layui.admin;

    //表单提交事件
    form.on('submit(btnSubmit)', function (data) {
        var ajax = new $ax(Feng.ctxPath + "/bKeywordAutoBack/addItem", function (data) {
            Feng.success("添加成功！");

            //传给上个页面，刷新table用
            admin.putTempData('formOk', true);

            //关掉对话框
            admin.closeThisDialog();

        }, function (data) {
            Feng.error("添加失败！" + data.responseJSON.message)
        });
        ajax.set(data.field);
        ajax.start();

        return false;
    });
    
    
    form.on('radio(returnType)', function (data) {
        //alert(data.elem);
        //console.log(data.elem);
        //alert(data.value);//判断单选框的选中值
       // var abc=data.value;
        
        $(".msg-info").removeClass("text");
        $(".msg-info").removeClass("iamge");
        $(".msg-info").removeClass("article");
        $(".msg-info").removeClass("video");
        
        
        $(".msg-info").addClass(data.value);

         //console.log(data.value);
         //alert(data.othis);
        //layer.tips('开关checked：' + (this.checked ? 'true' : 'false'), data.othis);
        //layer.alert('响应点击事件');
    });

});